package Classes.GameUtils// ActionScript file
{
	import flash.geom.Point;

	/**
	 *二等角转化逻辑类 
	 * @author 葛增文
	 * 
	 */	
	public class GU_IsoUtils
	{
		/**
		 *等角坐标转化为屏幕坐标 
		 * @param pos 等角坐标点
		 * @return 屏幕坐标点
		 * 
		 */		
		public static function isoToScreen(pos:Point):Point
		{
			var screenX:Number=pos.x-pos.y;
			var screenY:Number=(pos.x+pos.y)*0.5;
			return new Point(screenX,screenY);
		}
		
		/**
		 *屏幕坐标转化为等角坐标 
		 * @param pos 屏幕坐标点
		 * @return 等角坐标点
		 * 
		 */		
		public static function screenToIso(pos:Point):Point
		{
			var isoX:Number=pos.y+pos.x*0.5;
			var isoY:Number=pos.y-pos.x*0.5;
			return new Point(isoX,isoY);
		}
	}
}